#include "../RealtimeUI/RealTimeWindow.hpp"
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#include <thread>

int main()
{
  auto app=Gtk::Application::create("org.HBTY.RealTimeWindow.test");
  RealTimeWindow rlWin("","");
  int x,y,n;
  unsigned char* pic=stbi_load("bb.png",&x,&y,&n,0);
  if(pic!=nullptr)
  {
    ImageType newImage;
    newImage.data=pic;
    newImage.width=x;
    newImage.height=y;
    newImage.data_size=x*y*n;
    std::thread waitShow([&](){
      using namespace std::chrono_literals;
      std::this_thread::sleep_for(3s);
      rlWin.ShowOriginImage(newImage,0);
    });
  }
  app->signal_activate().connect([&rlWin,&app](){rlWin.test_call(app);});
  return app->run();
}
